var express = require('express');
var router = express.Router();
const userSerivice = require('../ThreeLayerArchitecture/services/userservices.js')

/* GET home page. */
router.post('/login', async function(req, resp) {
  let {name,pwd} = req.body;
 let res=  await userSerivice.login(name,pwd);
 if(res==null){
       resp.json({"code":0,"msg":"登录失败"})
 }else{
       resp.json({"code":1,"msg":"登录成功"})
 }
});

module.exports = router;